-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-120417: Fix "imported but unused" linter warnings #120461
Conversation
Add __all__ to the following modules: collections.abc, importlib.machinery, importlib.util and xml.sax. Add also "# noqa: F401" in subprocess and xml.sax on two lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only nitpick is to put them in alphabetical order, to make it easier to find an import when scanning the list.
Are you talking about |
I updated the PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is easy to get __all__
de-synchronized with the module content. I think that all changed modules need tests for __all__
. See existing tests that use support.check__all__
.
Ok, I added tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I tested that __all__
includes all non-underscored names except module names.
…0461) Add __all__ to the following modules: importlib.machinery, importlib.util and xml.sax. Add also "# noqa: F401" in collections.abc, subprocess and xml.sax. * Sort __all__; remove collections.abc.__all__; remove private names * Add tests
…0461) Add __all__ to the following modules: importlib.machinery, importlib.util and xml.sax. Add also "# noqa: F401" in collections.abc, subprocess and xml.sax. * Sort __all__; remove collections.abc.__all__; remove private names * Add tests
…0461) Add __all__ to the following modules: importlib.machinery, importlib.util and xml.sax. Add also "# noqa: F401" in collections.abc, subprocess and xml.sax. * Sort __all__; remove collections.abc.__all__; remove private names * Add tests
Add
__all__
to the following modules: collections.abc, importlib.machinery, importlib.util and xml.sax.Add also "# noqa: F401" in subprocess and xml.sax on two lines.